/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.dao;

import br.com.deployment.daogenerico.DaoGenerico;
import br.com.deployment.entidade.humana.Titular;
import br.com.deployment.interfaces.TitularDaoIn;
import java.util.List;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author luciano
 */
@Stateless
@LocalBean
public class TitularDao extends DaoGenerico<Titular> implements TitularDaoIn{

    public TitularDao() {
        super(Titular.class);
    }
    
    public Titular findNome(String nome){
        Titular titular = new Titular();
        System.out.println("Nome::" + nome);
        Query query = getEm().createQuery("select t from Titular t where t.nome like :nome");
        query.setParameter("nome", nome);
        System.out.println("Nome pessoa1::" + titular);
        titular = (Titular) query.getSingleResult();
        System.out.println("Nome pessoa::" + titular);
        return titular;
    }
    
    public List<Titular> findTitular(Titular titular) {
      return null;
    }    
    
}
